﻿Server_Detected = call compile preprocessFile "scripts\common.sqf";

If (X_Client) then {
	waituntil{alive player};
	sleep 0.5;
	if (player != leader group player) exitwith {};
	diag_log Format["Initializing AirSupply for %1", player];
	menu_ASammobox = player addAction ["Air Drop Box", "scripts\AirSupply\ASSelection.sqf", 0, 0, false, true, "", "true"];
	menu_ASvehicle = player addAction ["Air Drop Vehicle", "scripts\AirSupply\ASSelection.sqf", 1, 0, false, true, "", "true"];

	If (isNil("X_AirSupplyIsAvailable")) then {
			X_AirSupplyIsAvailable = true;
			publicVariable "X_AirSupplyIsAvailable";
	};

	If (isNil("X_AirSupplyEventHandler")) then {
		diag_log "Adding AirSupply Killed Event Handler";
		X_AirSupplyEventHandler = {execVM "scripts\AirSupply\ASInitMenu.sqf"};
		player addeventhandler ["Killed", X_AirSupplyEventHandler];
	};
};